package com.smzd.core.domain;

/**
 * 一个实现了IReferenceEntity接口的实体类，具有一个reference属性和相关的getter/setter
 * 
 * @author YuZhongda
 *
 * @param <K>
 */
public class BaseReferenceEntity<K extends IntIdEntity> extends BaseIntIdEntity implements IReferenceEntity<K> {
	private static final long serialVersionUID = -421282678847401070L;

	protected K reference;

	@Override
	public void setReference(K reference) {
		this.reference = reference;
	}

	@Override
	public K getReference() {
		return reference;
	}

	@Override
	protected void extStrings(StringBuffer sb) {
		super.extStrings(sb);
		sb.append(", reference: ").append(reference == null ? null : reference.getId());
	}
}
